﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Game.Objects;
using Game.Toolkit;
using System.Collections.ObjectModel;
using Game.Types;

namespace Game.Editor.Toolbox
{
    public class StandardTerrainControl2 : UserControl
    {
        readonly WrapPanel _Panel = new WrapPanel();

        public StandardTerrainControl2()
        {
            InitializeComponent();
            Init();
        }
        
        void InitializeComponent()
        {
            Grid grid = new Grid();
            this.Content = grid;

            ScrollViewer viewer = new ScrollViewer();
            grid.Children.Add(viewer);

            viewer.Content = _Panel;
        }

        void Init()
        {
            Collection<ObjectType> col = StandardToolkit.TerrainObjectTypes;
            foreach (ObjectType v in col) 
            {
                StandardTerrainItemControl2 control = 
                    new StandardTerrainItemControl2();
                control.MapItemType = v;
                control.Width = 50;
                control.Height = 50;
                _Panel.Children.Add(control);
            }
        }
    }
}
